﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CategoryOto.ascx.cs" Inherits="UserControls_CategoryOto" %>
<%@ Import Namespace="BLL" %>
<script runat="server">
    CategoryBLL cateData = new CategoryBLL();
</script>
<ul>
    <%
        var listCate = cateData.GetByParent(14, 4);

        for (int i = 0; i < listCate.Count; i++)
        {
            string name = listCate[i].Name;
            string images = listCate[i].Image;
            string description = HttpUtility.HtmlDecode(listCate[i].Description);
            string url = "/ClassDetail.aspx?Id=" + listCate[i].Id;
            if (i == listCate.Count - 1)
            {
    %>
    <li class="last">
        <div class="post">
            <a href="<%=url %>">
                <img src="/Images/Category/<%=images %>" alt="" title="<%=name %>" /></a>
                <h3><%=name %></h3>
            <div class="padding" style="font-size: 1.2em;">
                    <%=description%>
            </div>
        </div>
    </li>
    <%
}
                else
                { 
    %>
    <li>
        <div class="post">
            <a href="<%=url %>">
                <img src="/Images/Category/<%=images %>" alt="" title="<%=name %>" /></a>
                <h3><%=name %></h3>
            <div class="padding" style="font-size: 1.2em; font-family: Arial;">
                    <%=description %>
            </div>
        </div>
    </li>
    <%
}

            }
    %>
</ul>
